#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

int main (int argc, char **argv)
{
	FILE *read_fp = NULL;
	char buffer[BUFSIZ + 1];
	int chars_read;
	memset(buffer, 0, sizeof(buffer));
	read_fp = popen("uname -a", "r");
	if (read_fp != NULL)
	{
		chars_read = fread(buffer, sizeof(char), BUFSIZ, read_fp);
		if (chars_read > 0)
		{
			printf("Output was:\n%s\n", buffer);
		}
		pclose(read_fp);
		exit(0);
	}
	exit(-1);
}
